package com.wangqingbo.myspringbootproject.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.LocaleResolver;

/**
 * 调用语言或地区的代码
 */
//@Component
@Configuration
public class MessageBootResolver {

    /**
     * 注册成bean，在springboot中起作用
     * bean的名称要用localeResolver
     * @return
     */
    @Bean("localeResolver")
    public LocaleResolver getLocaleResolver()
    {
        return new MessageLocaleResolver();
    }
}
